class Solution {
public:
    vector<vector<int> > FindContinuousSequence(int sum) {
        vector<vector<int>> res;
        if(sum<3)
            return res;
        int small = 1;
        int big=2;
        int middle=(sum+1)>>1;
        int currentSum=big+small;
        while(small<middle){
            if(currentSum==sum){
                vector<int> temp;
                for(int i=small;i<=big;i++){
                    temp.push_back(i);
                }
                res.push_back(temp);
                big++;//这步很容易忘
                currentSum+=big;
            }
            else if(currentSum>sum){
                currentSum-=small;
                small++;
            }
            else{
                big++;
                currentSum+=big;
            }
        }
        return res;
    }
};